package com.ag.zrt.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ag.bean.TbLogPlanStep;
import com.ag.bean.TbLogPsContent;
import com.ag.bean.TbLogType;
import com.ag.zrt.dao.TbLogPsContentDAO;
import com.ag.zrt.service.ILogPsContentService;

@Service("LogPsContentService")
public class LogPsContentService implements ILogPsContentService {
	@Resource(name = "ZRTTbLogPsContentDAO")
	private TbLogPsContentDAO logPsContentDAO;

	public void setLogPsContentDAO(TbLogPsContentDAO logPsContentDAO) {
		this.logPsContentDAO = logPsContentDAO;
	}

	@Override
	public void add(String newStepId, String newContent, String typeId) {
		// TODO Auto-generated method stub
		try {
			TbLogPsContent lpc = new TbLogPsContent();
			TbLogType lt = new TbLogType();
			TbLogPlanStep lps = new TbLogPlanStep();

			System.out
					.println(newStepId
							+ "////////////////////////////////////newStepId///////////////////////////////////////////////");

			lps.setPsId(newStepId);

			// 设置日志类型
			lt.setLtId(typeId);

			lpc.setPscContent(newContent);

			lpc.setTbLogType(lt);

			lpc.setTbLogPlanStep(lps);

			logPsContentDAO.save(lpc);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
